package com.aaa.charge.api.BackfeeList;

import com.aaa.charge.feign.DateFegin;
import com.aaa.charge.service.BackfeeService;
import com.aaa.charge.vo.OrderBackfeeVo;
import com.aaa.entity.DictData;
import com.aaa.entity.OrderBackfee;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
 * @author pzs
 * @date 2023/3/24 11:22
 * @description ApiChargeController
 */
@RestController
@RequestMapping("charge/api/orderBackfee")
public class ApiBackfeeController {
    @Autowired
    private BackfeeService orderBackfeeService;
    @Resource
    private DateFegin dateFegin;
    /**
     * 退费查询
     * 查询表格退费内容
     * @return
     */
    @PostMapping("queryBackgee/{currentPage}/{pageSize}")
    public Result<IPage<OrderBackfee>> queryCharge(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            @RequestBody OrderBackfeeVo orderBackfeeVo
    ){
        return orderBackfeeService.findAllBackfee(currentPage,pageSize,orderBackfeeVo);
    }
    //状态。类型。。。
    @GetMapping("getByType/{type}")
    public Result<List<DictData>> getByType(@PathVariable String type){
        Result<List<DictData>> list = dateFegin.list(type);
        return list;
    }



}
